﻿// the W1 program to rewrtie the frist Wclass HTTPserver program ,and the frist C++ program for me 

#include "resw1.hpp"

extern HANDLE server_thread;

int main()
{
	if (pre_start())
	{
		string cmd,reply;
		SetConsoleCtrlHandler(cshand, true);
		server_thread = CreateThread(NULL, NULL, serverf, NULL, NULL, NULL);
		cout << "prepare finish" << endl << "server start" << endl;
		while (true)
		{
			cin >> cmd;
			if (cmd == "close")
				break;
			reply = cmd_handle(cmd);
			cout << reply << endl;
		}
		WSACleanup();
	}
	return 0;
}

